package com.ink;

import com.printer.Ink;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import java.awt.*;


@Component("colorInk")
public class ColorInk implements Ink {
    /**
     * 打印采彩色文字
     */

    public String getColor(int red, int green, int blue) {
        Color color = new Color(red, green, blue);
        return "#" + Integer.toHexString(color.getRGB()).substring(2);
    }

}
